/*
 * @Author: ckk
 * @Date: 2022-08-26 15:47:19
 * @LastEditors: ckk
 * @LastEditTime: 2022-08-30 17:28:07
 * @Description: 同步培优所涉及的接口
 */
import axios from './request';
/**
 * @description: 获取年级学期列表
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-27 10:57:39
 * @return {*}
 */
export async function getGradeList (params) {
    const { data } = await axios.get(
      '/gw/ucsapi/isch-c/v1/user/stage/grade/sch',
      { ...params }
    );
    return (data || {});
}
/**
 * @description: 获取了书本的版本
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-27 11:01:26
 * @return {*}
 */
export async function getBookVersion (params) {
    const { data } = await axios.get(
      '/gw/ucsapi/isch-c/v1/user/stage/grade/sch',
      { ...params }
    );
    return (data || {});
}
/**
 * @description: 获取教材海报
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-29 16:12:08
 * @return {*}
 */
export async function getBookImage (params) {
  const { data } = await axios.get(
    `${process.env.VUE_APP_NRMS_URL}/rms/v1/catalogue/list_posters`,
    {
      params: {
        ...params
      }
    }
  );
  return (data || {});
}
/**
 * @description: 修改课本版本
 * @param {*} params
 * @Author: ckk
 * @Date: 2022-08-30 11:21:04
 * @return {*}'/gw/ucsapi/isch-c/student/book/last'
 */
export async function editBookVersion (params) {
  const Qs = require('qs'),
  { data } = await axios({
    method: 'POST',
    url: '/gw/ucsapi/isch-c/student/book/last',
    headers: {
      'content-type': 'application/x-www-form-urlencoded'
    },
    data: Qs.stringify(params)
  });
  return (data || {});
}
